package org.sao.admin.controller;


import org.sao.admin.service.SysUserService;
import org.sao.common.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.*;
/**
 * @author lengleng
 * @date 2017/10/28
 */
@RestController
@RequestMapping("/user")
public class UserController  {
    private static final PasswordEncoder ENCODER = new BCryptPasswordEncoder();

    @Autowired
    private SysUserService userService;

    /**
     * 通过用户名查询用户及其角色信息
     *
     * @param username 用户名
     * @return UseVo 对象
     */
    @GetMapping("/findUserByUsername/{username}")
    public UserVo findUserByUsername(@PathVariable String username) {
    	
    	UserVo uv=userService.findUserByUsername(username);
    	System.out.println(username +"---"+uv);
        return uv;
    }




 


}
